import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
// import Register from '../views/test/Register.vue'


Vue.use(VueRouter)

const router = new VueRouter({
  mode: 'history',
  routes:[
    {
      path: '/',
      redirect: '/Login'
    },

    {
      path: '/Login',
      name: 'Login',
      component: Login,
    },

    {
      path: '/FramePalm',
      name: 'FramePalm',
      component: ()=> import('../components/FramePalm.vue'),
    },

    {
      path: '/ResultPalm',
      name: 'ResultPalm',
      component: ()=> import('../components/ResultPalm.vue'),
    },
    {
      path: '/Frame',
      name: 'Frame',
      component: ()=> import('../components/Frame.vue'),
      redirect: '/Palm',

      children:[
        {
          path: '/Palm',
          name: 'Palm',
          component: () => import('../components/pages/Palm.vue')
        },
        {
          path: '/Tongue',
          name: 'Tongue',
          component: () => import('../components/pages/Tongue.vue')
        },
        {
          path: '/CollectEye',
          name: 'CollectEye',
          component: () => import('../components/pages/CollectEye.vue')
        },
        {
          path: '/result',
          name: 'Result',
          component: () => import('../components/pages/result.vue')
      },
  
      
      ]
    }
    ]
})


export default router


// 解决vue-router在3.0版本以上重复报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}